package com.express.mybatis;

import java.io.Serializable;

/**
 * Result : 响应的结果对象
 *
 * @author zhouling
 * @since 2018-09-27 16:28
 */
public class Result implements Serializable {
    private static final long serialVersionUID = 6288374846131788743L;

    /**
     * 信息
     */
    private String message;

    /**
     * 状态码
     */
    private int statusCode;

    private String status;

    /**
     * 是否成功
     */
    private boolean success;

    private Object data;
    
    public Result() {
		this.statusCode = 200;
		this.status = "200";
		this.success = true;
	}

	public Result(String message, int statusCode, boolean success) {
		this.message = message;
		this.statusCode = statusCode;
		this.success = success;
	}
    public Result(String message, String status) {
        this.message = message;
        this.status = status;
    }

    public void error(String message, String status) {
        this.message = message;
        this.status = status;
    }
	public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public boolean isSuccess() {
        return success;
    }

    public void setSuccess(boolean success) {
        this.success = success;
    }

    public int getStatusCode() {
        return statusCode;
    }

    public void setStatusCode(int statusCode) {
        this.statusCode = statusCode;
    }
    
    public void error(String message, int statusCode) {
    	this.success = false;
    	this.message = message;
    	this.statusCode = statusCode;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }
}
